home *** CD-ROM | disk | FTP | other *** search
- Path: hickory.westol.com!news
- From: Mark Kintigh <breetai@oak.westol.com>
- Newsgroups: comp.lang.c
- Subject: Mouse Routines using C/C++
- Date: Fri, 19 Jan 1996 16:07:59 -0800
- Organization: Westmoreland Online Inc.
- Message-ID: <3100325F.5D@oak.westol.com>
- NNTP-Posting-Host: pm118.westol.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b4a (Win16; I)
-
- Jon Day wrote:
- >
- > I have some simple routines to implement a mouse handler is assembler but
- > nothin in C or C++. Can anyone provide me with example code on how to set
- > up an interrupt handler for the mouse using only C?
- >
- > I am working on a project that requires the use of the mouse but I want to
- > write the code only in C and not in assembler.
- >
- > Any help is greatly appreciated and you can reply directly to me.
-
-
- I've written them origionally using int86(), but I find that in-line
- assembler code works 1000 times better. Code like...
-
- int getmousestats(int *row, int *col)
- {
- int r, c, b;
-
- _asm
- {
- mov ax,0003h
- int 33h
- mov r,dx
- mov c,cx
- mov b,bx
- }
- *row=r;
- *col=c;
- return(b);
- }
-
- ...is short, sweet, and works nicely. If you *really* want the 100% C
- version of the mouse routines I have I'll try to dig them up, but I
- think I've trashed them in favor of the better functions.
- --
- _____
- / /## breetai@oak.westol.com
- / /#### ____
- (| []/ o ##) "We met the enemy, and they were'nt us, then | _|||
- |\ \_/ /\ # /| we faced a pannel of 'us' and found they were || ||
- | \-\ ==== /-/ | the enemy." \\//
- ||\\ '----' //|| \/
- || \\/ \// ||
-